#include "cdesktopapp.h"
#include "cdesktop.h"

#include <buola/gui/ctoolkit.h>

namespace buola { namespace bdesktop {

CDesktopApp *gDesktopApp;

CDesktopApp::CDesktopApp() 
{
}

CRootWindow *CDesktopApp::GetRoot()
{
    gRootWindow=new CRootWindow;
    gRootWindow->Create();
    return gRootWindow;
}

bool CDesktopApp::Start()
{
    CApp::Start();

    mDock=new CDock;
    mDock->Create(nullptr);
    mDock->Show();

    mAppManager=new CAppManager(mDock);
    mVolumeManager=new CVolumeManager(mDock);

    gRootWindow->Init();

    CDesktop *lDesktop=new CDesktop;
    lDesktop->Create(nullptr);
    set_main_window(lDesktop);
    lDesktop->Show();
    mTopBar=new CTopBar;
    mTopBar->Create(nullptr);
    mTopBar->Show();

    return true;
}

CDesktopApp::~CDesktopApp()
{
}

/*namespace bdesktop*/ } /*namespace buola*/ }
